<?php
/**
 * 订单api管理
 * Created by Sublime Text 3.
 * @authors Rejeo (rejeo@qq.com)
 * @date    2018-04-23 15:30:22
 */
namespace app\api\controller;

use think\Controller;
use think\Request;
use app\common\model\Order as OrderModel;

class Order extends Controller
{
    private $link;

    // 重载父类的初始化设置
    public function _initialize()
    {
        $this->link = new OrderModel();
    }

    public function payStatus(Request $request)
    {
        // 判断是否登录
        $id = $request->post('id', 0 ,'intval');
        if (empty($id)) {
            $this->result('', 500, '查询有误！');
        }

        $order = $this->link->find($id);

        if ($order['pay_status'] === 1) {
            $this->result('', 200, '查询成功！');
        }

        $this->result('', 500, '查询失败！');
    }
}
